import 'package:rfid/generated/json/base/json_field.dart';
import 'dart:convert';

import '../generated/json/setting_entity.g.dart';

@JsonSerializable()
class SettingEntity {

	@JSONField(name: "api_addr")
	String? apiAddr;
  String? picApiAddr;
  String? faceApiAddr;
  String? psw;
  String? appKey;
  String? commonUid;
  String? analysisBook;
  String? analysisReader;
  String? executable;
  String? face;
  String? kdApi = '10.113.1.11:18080';

  bool? isUltra = false;
  bool? canReturnIfOver = true;
  int? blockStart;
  int? blockCount;
  int? scanTime;
  double? scale1;
  double? scale2;
  double? translateX1;
  double? translateX2;
  double? translateY1;
  double? translateY2;
  @JSONField(name: "publish_name")
  String? publishName;
  @JSONField(name: "web_socket_addr")
	String? webSocketAddr;
	List<SettingEntityReader>? reader;
	String? auth = '1';
	@JSONField(name: "device_name")
	String? deviceName;
  @JSONField(name: "device_no")
  String? deviceNo;
	@JSONField(name: "normal_countdown")
	int? normalCountdown;
	@JSONField(name: "fast_countdown")
	int? fastCountdown;
	@JSONField(name: "slow_countdown")
	int? slowCountdown;
	String? index = '1号柜';

  SettingEntity();

  factory SettingEntity.fromJson(Map<String, dynamic> json) => $SettingEntityFromJson(json);

  Map<String, dynamic> toJson() => $SettingEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class SettingEntityReader {

	String? readerIp;
	String? addr;
  String? ant;
  String? lock;
  String? doorNo;
  //0启用 1禁用
  int? state = 0;

  SettingEntityReader();

  factory SettingEntityReader.fromJson(Map<String, dynamic> json) => $SettingEntityReaderFromJson(json);

  Map<String, dynamic> toJson() => $SettingEntityReaderToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
